<HTML><HEAD><TITLE>mzn_run(+ModelFile, +InstFileOrParMap, ++SolverOrOptions)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">library(minizinc)</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>mzn_run(+ModelFile, +InstFileOrParMap, ++SolverOrOptions)</H1>
Run a MiniZinc model from a given model and instance file
<DL>
<DT><EM>ModelFile</EM></DT>
<DD>File name (extension defaults to .mzn)
</DD>
<DT><EM>InstFileOrParMap</EM></DT>
<DD>Instance file name (extension defaults to .dzn, then .mzn), or list of Id=Term correspondences
</DD>
<DT><EM>SolverOrOptions</EM></DT>
<DD>Name of solver mapping module, or zn_options-structure
</DD>
</DL>
<H2>Description</H2>
<P>
	Reads a MiniZinc model (given a model file and an instance
	file) and interprets it using the solver mapping defined in
	SolverOrOptions.  At the end of solving, resuls and timings
	are printed to the output stream.  Error messages may be
	printed to the error stream.  This predicate always succeeds.
    </P>
<H3>Modes and Determinism</H3><UL>
<LI>mzn_run(+, +, ++) is det
</UL>
<H2>Examples</H2>
<PRE>
    ?- mzn_run("mymodel.mzn", "myinstance.mzn", fzn_ic).
    Found a solution with cost 10
    Found no solution with cost 7.0 .. 9.0
    end = 10
    b1 = 1
    b2 = 0
    b3 = 1
    b4 = 0
    Objective value = 10
    Total time 0.031s cpu (0.016 setup + 0.000 search)

    ?- mzn_run("queens.mzn", [n=8], fzn_ic).
    Starting search
    q = [1,5,8,6,3,7,2,4]
    Total time 0.015s cpu (0.000 setup + 0.000 search)
</PRE>
<H2>See Also</H2>
<A HREF="../../lib_public/minizinc/mzn_run-2.html">mzn_run / 2</A>, <A HREF="../../lib_public/minizinc/mzn_run_string-2.html">mzn_run_string / 2</A>, <A HREF="../../lib_public/flatzinc/zn_options-s.html">flatzinc : struct(zn_options)</A>
</BODY></HTML>
